package com.luych.toolbox.base.service.dao;

import com.luych.toolbox.base.service.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Optional;

public interface UserDao extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {

    Optional<User> findByLoginName(String loginName);

    Page<User> findByLoginNameLikeOrUserNameLike(String loginName, String userName, Pageable pageable);

}